﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DLULearningNetworkModel;

namespace DLULearningNetwork.ViewModels
{
    public class VerticalMenu
    {
        public string Name { get; set; }
        public string DisplayedName { get; set; }
        public string Href { get; set; }
        public List<VerticalMenu> SubMenu { get; set; }
        public VerticalMenu()
        {
            SubMenu = new List<VerticalMenu>();
        }
        public VerticalMenu(string name, string displayedName, string href, List<VerticalMenu> submenu)
        {
            Name = name;
            DisplayedName = displayedName;
            Href = href;
            SubMenu = submenu;
        }
        public static VerticalMenu CreateMainLeftVertical()
        {
            VerticalMenu mainLeftMenu = new VerticalMenu();
            mainLeftMenu.Name = "MainLeftMenu";

            VerticalMenu homePage = new VerticalMenu("HomePage", "Trang chủ", @"/Home/HomePage", null);
            mainLeftMenu.SubMenu.Add(homePage);

            VerticalMenu personal = new VerticalMenu("Personal", "Cá nhân", @"/Profile/Edit", new List<VerticalMenu>());
            personal.SubMenu.Add(new VerticalMenu("Personal_EditProfile", "Sửa thông tin cá nhân", @"/Profile/Edit", null));
            personal.SubMenu.Add(new VerticalMenu("Personal_EditPrivacy", "Sửa riêng tư", @"/Privacy/", null));
            personal.SubMenu.Add(new VerticalMenu("Personal_ChangePassword", "Đổi mật khẩu", @"/Account/ChangePassword", null));
            personal.SubMenu.Add(new VerticalMenu("Personal_ChangeAvatar", "Đổi Avatar", @"/Profile/ChangeAvatar", null));
            mainLeftMenu.SubMenu.Add(personal);

            VerticalMenu friendShip = new VerticalMenu("FriendShip", "Bạn bè", @"/Friend/MyFriend/", new List<VerticalMenu>());
            friendShip.SubMenu.Add(new VerticalMenu("FriendShip_MyFriend", "Danh sách bạn bè", @"/Friend/MyFriend/", null));
            friendShip.SubMenu.Add(new VerticalMenu("FriendShip_FriendRequest", "Chờ kết bạn", @"/Friend/FriendRequest", null));
            friendShip.SubMenu.Add(new VerticalMenu("FriendShip_Search", "Tìm kiếm bạn", @"/Friend/Search", null));
            mainLeftMenu.SubMenu.Add(friendShip);

            VerticalMenu courseList = new VerticalMenu("Courses", "Học tập", "/Course/", new List<VerticalMenu>());
            courseList.SubMenu.Add(new VerticalMenu("Courses_MyCourses", "Lớp của bạn", "/Course/Personal", null));
            courseList.SubMenu.Add(new VerticalMenu("Courses_Attendance", "Các lớp khác", "/Course/Community", null));
            //courseList.SubMenu.Add(new VerticalMenu("Courses_Search", "Tìm lớp học", "#", null));
            mainLeftMenu.SubMenu.Add(courseList);

            VerticalMenu resources = new VerticalMenu("Resource", "Tài nguyên", "#", new List<VerticalMenu>());
            resources.SubMenu.Add(new VerticalMenu("", "Tài nguyên của bạn", "/Resource/Personal", null));
            resources.SubMenu.Add(new VerticalMenu("", "Tài nguyên cộng đồng", "/Resource/Community", null));
            mainLeftMenu.SubMenu.Add(resources);
            return mainLeftMenu;
        }
        public static VerticalMenu CreateUserPageMenu(Account ownerUser)
        {
            VerticalMenu mainLeftMenu = new VerticalMenu();
            mainLeftMenu.Name = "MainLeftMenu";

            VerticalMenu homePage = new VerticalMenu("", "Tường cá nhân", @"/UserPage/UserHome/"+ownerUser.Nickname_s, null);
            mainLeftMenu.SubMenu.Add(homePage);

            VerticalMenu personal = new VerticalMenu("", "Thông tin cá nhân", @"/UserPage/Info/" + ownerUser.Nickname_s, null);
            mainLeftMenu.SubMenu.Add(personal);

            VerticalMenu friendShip = new VerticalMenu("FriendShip", "Bạn bè", @"/UserPage/FriendList/" + ownerUser.Nickname_s, null);
            mainLeftMenu.SubMenu.Add(friendShip);

            return mainLeftMenu;
        }
    }
}